import { request } from "../utils/request";

// 获取当前帖子下全部评论
export function getComments(query) {
  return request.get("/comments", query);
}

// 根据id获取评论详情
export function getCommentDetail(query) {
  return request.get("/comments/getCommentById", query);
}

// 添加评论
export function addComment(data) {
  return request.post("/comments", data);
}

// 删除评论
export function deleteComment(data) {
  return request.post("/comments", data);
}

// 修改评论
export function updateComment(data) {
  return request.put("/comments", data);
}

// 点赞评论
export function likeComment(id) {
  return request.put(`/comments/likeComment?commentId=${id}`);
}
